package com.wechat.service.impl;

import com.wechat.dao.WechatUserMapper;
import com.wechat.entity.WechatUser;
import com.wechat.service.WechatUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("wechatUserServiceImpl")
public class WechatUserServiceImpl implements WechatUserService {

    @Autowired
    private WechatUserMapper wechatUserMapper;

    @Override
    public int insertUser(WechatUser user) {
        return wechatUserMapper.insert(user);
    }

    @Override
    public WechatUser getUserByOpenId(String openId) {
        return wechatUserMapper.selectByOpenId(openId);
    }

    @Override
    public int updateUser(WechatUser user) {
        return wechatUserMapper.updateByPrimaryKeySelective(user);
    }
}
